﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="CanDoo.Oil.WebHost.ViewBulletin.List" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="/res/login/css/styles.css" />
    <title><%=CanDoo.Oil.WebHost.Code.StaticConfig.UserTitle + " | " + CanDoo.Oil.WebHost.Code.StaticConfig.SysTitle %></title>
</head>
<body>
    <form id="form1" runat="server">
        <div class="tod_contain cblue">
            <div class="top_contain">
                <div class="head">
                    <div class="platname">
                        <a href="/Default.aspx"><img src="/res/login/images/logo.png" /></a><h2><%= CanDoo.Oil.WebHost.Code.StaticConfig.SysTitle %></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="main_contain">
            <div class="main">
                <div class="mnews_list">
                    <div class="title">
                        <h2>最新动态</h2>
                    </div>
                    <div class="list">
                        <%
                            DB.KeepReading(()=>
                            {
                                string str = "<ul>\r\n";

                            var bList = BulletinContract.Entities.OrderByDescending(p => p.IsTop).ToList();

                            foreach (var m in bList)
                            {
                                str += "<li>\r\n";
                                if (m.IsTop)
                                    str += "<h2><a href=\"Detail.aspx?Id=" + m.Id.ToString() + "\" target=\"_ablank\"><span>" + m.Name + "</span></a></h2>\r\n";
                                else
                                    str += "<h2><a href=\"Detail.aspx?Id=" + m.Id.ToString() + "\" target=\"_ablank\">" + m.Name + "</a></h2>\r\n";
                                str += "<h3>（" + m.User.Name + "，" + string.Format("{0:yyyy-MM-dd}", m.CreateDate) + "）</h3>\r\n";
                                str += "</li>\r\n";
                            }
                            str += "</ul>\r\n";
                            Response.Write(str);
                            });
                            
                        %>
                    </div>
                </div>
            </div>
        </div>
        <div class="foot_contain">
            <div class="main">
                <h2><%= CanDoo.Oil.WebHost.Code.StaticConfig.Links %><br />
                    <%= CanDoo.Oil.WebHost.Code.StaticConfig.Copyright %></h2>
            </div>
        </div>
    </form>
</body>
</html>